<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加信用评定信息</title>
<%@ include file="/WEB-INF/sys/include/css.jsp"%>
<link href="${path}/res/js/webuploader/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form" action="${path}/credit/save.json" method="post">
<div class="form">
	<div class="title">添加信用评定信息</div>
	<div class="group">
		<div class="label">*被评定主体:</div>
		<div class="item">
			<input type="text" id="companyName" name="companyName" />
			<input type="hidden" name="companyid" id="companyid" />
		</div>
		<div class="item" id="companyNameTip"></div>
	</div>
	<div class="group">
		<div class="label">现场检查情况:</div>
		<div class="item"><textarea id="inspectDesc" name="inspectDesc"></textarea></div>
	</div>
	<div class="group">
		<div class="label">现场检查附件:</div>
		<div class="item"><div id="inspectAttachment" class="myuploader myuploader-single"></div></div>
	</div>
	<div class="group">
		<div class="label">*评定人:</div>
		<div class="item"><input type="text" name="evaluateBy" id="evaluateBy" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">评定结果:</div>
		<div class="item"><textarea id="evaluateDesc" name="evaluateDesc"></textarea></div>
	</div>
	<div class="group">
		<div class="label">*评定单位名称:</div>
		<div class="item"><input type="text" name="evaluateUnit" id="evaluateUnit" maxlength="20" /></div>
	</div>
	<div class="group">
		<div class="label">*评定等级:</div>
		<div class="item">
			<input type="radio" name="evaluateLevel" id="carousela" checked="checked" value="A"/><label for="carousela">A</label>
			<input type="radio" name="evaluateLevel" id="carouselb" value="B"/><label for="carouselb">B</label>
			<input type="radio" name="evaluateLevel" id="carouselc" value="C"/><label for="carouselc">C</label>
		</div>
	</div>
	<div class="group">
		<div class="label">*评定时间:</div>
		<div class="item"><input type="text" name="evaluateTime" id="evaluateTime" ltype="date"/></div>
	</div>
	
	<div class="buttons">
		<button class="highlight" id="submit1" type="button">确定</button>
		<button type="button" id="cancel1">取消</button>
	</div>
</div>
</form>
<%@ include file="/WEB-INF/sys/include/script.jsp" %>
<script src="${path}/res/js/webuploader/webuploader.min.js" type="text/javascript"></script>
<script src="${path}/res/js/webuploader/myUploader.js" type="text/javascript"></script>
<script type="text/javascript">
var myuploader;
$(function() {
	myuploader = $("#inspectAttachment").myImgUploader({
		uploadDir: "credit_attachment"
	});
	
	createSelect("companyName", "companyid", {
		valueField:'companyid', textField: 'companyName',
		url:'${path}/credit/getCompanyData.json'
	});
	
	$("#form").ligerForm({inputWidth: 300});
	verifyForm("form", {}, function(){
		$("#form").ajaxForm(function(data){
			UiUtil.isSuccess(data, "添加信用评定信息成功", function(){
				UiUtil.closeForm(true);
			});
		});
	});
	
	$("#submit1").click(function(){
		UiUtil.lockButton('submit1');
		$("#form").submit();
	});

	$("#cancel1").click(function(){
		UiUtil.closeForm();
	});
	
});
</script>
</body>
</html>